package com.shanyue.redwine.utils;

import android.os.Environment;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.regex.Pattern;

public class Constants {
    /**
     * 系统可以处理的url正则
     */
    public static final Pattern ACCEPTED_URI_SCHEME = Pattern.compile("(?i)" + // switch on case
            // insensitive matching
            '(' + // begin group for scheme
            "(?:http|https|ftp|file)://" + "|(?:inline|data|about|javascript):" + "|(?:.*:.*@)" + ')' + "(.*)");
    public static final int RESULT_OK = 1;//接口返回正确标志
    public static final String DEAL_URL_APP_SHARE = "appshare:";//分享
    public static final String DEAL_URL_PAY_ALI = "alipay:";//分享
    public static final String DEAL_URL_PAY_WEIXIN = "wxpay:";//分享
    public static final String DEAL_URL_SCAN = "scan:";//分享
    public static final String DEAL_URL_CLOSE_WINDOW = "closeWindow:";//分享
    public static final String DEAL_URL_USER_COOKIE = "/usercenter.";//分享
    public static final String DEAL_URL_LOGOUT = "/endlogin.aspx";//分享
    public static final String URL_DOMIAN = "http://192.168.1.168:9600/ShanYue/api/";
    //{"token":"1",data:{"encode":"1"}}
    public static final String URL_OPEN_DOOR = URL_DOMIAN + "WineCabinet/Open";
    //{"token":"1",data:{"encode":"1"}}
    public static final String URL_WINE_CABINET_GOODS_LIST = "Label/list";
    //{"token":"1",data:{"page":"1","rows":"20",name:""}}
    public static final String URL_WINE_CABINET_ORDER_LIST = "Order/list";
    //{"token":"1",data:{"page":"1","rows":"20",name:""}}
    public static final String URL_WINE_CABINET_RECORD = "UsesLog/list";


    public static final String SP_CONFIG = "sp_config";
    public static final String SP_WX_PAY_TYPE = "sp_wx_pay_type";//支付类型 充值 订单支付
    public static final int WEIXIN_PAY_GOODS_ORDER = 1;//商品支付
    public static final int WEIXIN_PAY_RECHARGE = 2;//余额充值
    public static final String KEY_DATA = "KEY_DATA";
    public static final String KEY_OBJ = "KEY_OBJ";
    public static final String PAY_WEIXIN_APPID = "wx3cb6101d513ecbc6";
    public static final String ENCRYPT = "0tjqPyurECVu8Bh9riSTeQ==";//仅注册时用
    public static final String SP_ENCRYSTR = "SP_ENCRYSTR";//sp存储aes加密秘钥
    public static final String SP_KEY_ISLOGIN = "sp_key_islong";//判断用户是否登录
    public static final String SP_KEY_LOGIN_USER_INFO = "sp_key_user_info";//记录用户登录数据
    public static final String GUIDE_ON_OFF = "sp_key_guide_page_on_off";

    public static final int PAYMENT_ALI = 1;
    public static final int PAYMENT_WECHAT = 2;
    public static final String MEMBER_NO_AUTH = "E01";
    public static final String MATCHES_MONEY = "^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$";// 钱的正则
    public static final String MATCHES_IDCARD = "^(\\d{18}$)|(^\\d{17}(\\d|X|x))$";// 身份证的正则
    public static final String MATCHES_EMAIL = "^(\\w)+(\\.\\w+)*@(\\w)+((\\.\\w+)+)$";// 邮箱
    public static final String MATCHES_BANKCARD = "^[0-9]{16,19}$";// 银行卡
    public static final String MATCHES_PHONE = "^[1][0-9]{10}$";// 手机号码
    public static final String MATCHES_PASSWORD = "^[\\@A-Za-z0-9\\!\\#\\$\\%\\^\\&\\*\\.\\~]{6," + "22}$";// 银行卡
    // 2016-10-11 17:52:00
    public static final SimpleDateFormat DATE_FORMAT_YMD_HMS = new SimpleDateFormat("yyyy-MM-dd " + "HH:mm:ss");//
    public static final SimpleDateFormat DATE_FORMAT_YMD_HM = new SimpleDateFormat("yyyy-MM-dd " + "HH:mm");//
    public static final SimpleDateFormat DATE_FORMAT_YMD_H = new SimpleDateFormat("yyyy-MM-dd " + "HH");//
    public static final SimpleDateFormat DATE_FORMAT_YMD = new SimpleDateFormat("yyyy-MM-dd");//
    public static final SimpleDateFormat DATE_FORMAT_YM = new SimpleDateFormat("yyyy-MM");//
    public static final SimpleDateFormat DATE_FORMAT_HMS = new SimpleDateFormat("HH:mm:ss");//
    public static final SimpleDateFormat DATE_FORMAT_HM = new SimpleDateFormat("HH:mm");//

    public static final String DIR_ROOT = Environment.getExternalStorageDirectory().getPath() + File.separator +
            "meiyue";
    public static final String DIR_IMGS = DIR_ROOT + File.separator + "imgs";
    public static final String DIR_LOGS = DIR_ROOT + File.separator + "logs";
    public static final String API_MODEL = "Android";
    public static final String API_VERSION = "1.0.0";
    public static final int MAIN_TAB_DYNAMIC_INDEX = 2;//首页动态的索引
    public static final String JPUSH_CUSTOM_EXTRA_KEY = "extra_data";//推送自定义key
    public static final String JPUSH_CUSTOM_EXTRA_KEY_CODE = "code";//推送自定义key
    public static final String JPUSH_CUSTOM_EXTRA_KEY_DATA = "data";//推送自定义key
    /**
     * //收益到账
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_GAIN = 1;
    /**
     * //提现申请失败
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_WITHDRAW_FAIL = 2;
    /**
     * //提现到账成功
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_WITHDRAW_SUCCESS = 3;
    /**
     * //会员审核失败
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_MEMBER_AUTH_FAIL = 11;
    /**
     * //会员审核成功
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_MEMBER_AUTH_SUCCESS = 12;
    /**
     * //会员升级提醒
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_MEMBER_UPGRADE = 13;
    /**
     * 网页(商品 动态 公告等wap页面)
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_WAP = 21;//
    /**
     * 平台公告(纯文字公告)
     */
    public static final int JPUSH_CUSTOM_EXTRA_KEY_TIP = 31;//


    public static final String SP_KEY_OLD_VERSION = "key_old_version";

    public static final String SP_KEY_WINE_CABINET_ID = "sp_key_wine_cabinet_id";//酒柜唯一id
    public static final String SP_KEY_USER_ACCOUNT = "sp_key_user_account";
    public static final String SP_KEY_USER_PASSWORD = "sp_key_user_password";
    public static final String SP_KEY_USER_TOKEN = "sp_key_user_token";
    public static final String JPUSH_CUSTOM_EXTRA_KEY_CONTENT_TYPE = "ContentType";//推送自定义key
    public static final int JPUSH_CUSTOM_EXTRA_KEY_CONTENT_TYPE_WINECABINET_OPEN = 1;//开门通知
    public static final int JPUSH_CUSTOM_EXTRA_KEY_CONTENT_TYPE_WINECABINET_CLOSE = 2;//关门通知
}
